package com.taowan.xunbaozl.morning_speak.design_pattern.day17;

import java.util.ArrayList;
import java.util.List;

/**
 * com.taowan.xunbaozl.morning_speak.design_pattern.day17.app
 * Created by diql on 2016/3/14.
 */
public class ObjectStructure {
    List<Node> nodes = new ArrayList<>();

    public void action(Visitor visitor) {
        for(Node node : nodes) {
            node.accept(visitor);
        }
    }

    public void add(Node node) {
        nodes.add(node);
    }
}
